package com.tckdq.tcc.feign;

import com.tckdq.tcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFeignFallbackFactory implements FallbackFactory<CourseFeign> {
    @Override
    public CourseFeign create(Throwable throwable) {
        return new CourseFeign() {

            @Override
            public JsonResult selectCourseStatusForUser(Long id) {
                return JsonResult.error("获取课程状态失败");
            }

            @Override
            public JsonResult selCourseForOrder(String courseStrIds) {
                return JsonResult.error("获取课程订单失败");
            }
        };
    }
}
